import java.sql.*;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executor;

public class demon1 {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.cj.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/bag?serverTimezone = GMT";
        String name="root";
        String password="123qwe...";
        Connection connection=DriverManager.getConnection(url,name,password);
        Statement statement = connection.createStatement();
        String sql="select * from bags";
        ResultSet resultSet=statement.executeQuery(sql);
        while(resultSet.next()){
            int id =resultSet.getInt("id");
            int price=resultSet.getInt("price");
            System.out.println(id+"\t"+price);
        }
    }
}
